<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
  <!ENTITY dc "http://purl.org/dc/elements/1.1/">
  <!ENTITY dcterms "http://purl.org/dc/terms/">
  <!ENTITY foaf "http://xmlns.com/foaf/0.1/">
  <!ENTITY a "http://xmlns.heustics.org/schema/myelin/0.1/">
  <!ENTITY m "http://xmlns.heustics.org/ontology/myelin/0.1/">
]>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fhttp="http://xmlns.4suite.org/4ss/http"
  xmlns:a="http://xmlns.heustics.org/schema/myelin/0.1/"
  extension-element-prefixes="fhttp"
  exclude-result-prefixes="xsl fhttp a"
> 
  <xsl:template match="a:*[@resource-uri]">
    <xsl:apply-templates select="a:source/*"/>
  </xsl:template>  
  
  <xsl:template match="a:insufficient-rights">    
    <!-- if used on the client side, need to add a check
    to see if this fhttp:response-uri exists -->
    <!-- other methods including using javascript to redirect -->
    <fhttp:response-uri
      uri="{a:format-url-ext(
        a:format-redirect-to-return(          
          'login'
        ),
        'msg','insufficient-rights'
      )}"/>
  </xsl:template>
   
  <xsl:template match="a:file">
    <fhttp:return-resource path="{@node-id}"/>
  </xsl:template>
  
</xsl:stylesheet>

